<template>
  <div id="search">
    <div class="message">
      <h2>To Travel-Aid</h2>
      <h2>Choose Your First Destination</h2>
      <div class="search-wrapper">
        <div class="search-bar">
          <el-select v-model="category" placeholder="选择类型" class="search-select">
            <el-option label="景点" value="spot" />
            <el-option label="用户" value="user" />
            <el-option label="路线" value="route" />
          </el-select>

          <el-input v-model="keyword" placeholder="请输入关键词" class="search-input" />

          <el-button type="primary" :icon="Search" @click="onSearch" class="search-button">
            搜索
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Search } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { ref } from 'vue'

const onSearch = () => {
  ElMessage.info('搜索功能开发中')
}

const keyword = ref('')
const category = ref('spot')
</script>

<style scoped>
h2 {
  color: white;
  text-shadow: 5px 10px rgba(0, 0, 0, 0.3);
  font-size: 65px;
  font-family: RedBold;
  font-weight: 800;
}

#search {
  width: 100%;
  height: 90vh;
  background-image: url('@/assets/path.jpg');
  background-size: cover;
  position: relative;
}

.message {
  position: absolute;
  bottom: 15%;
  width: 80%;
  left: 10%;
}

.search-wrapper {
  width: 100%;
  padding: 50px 20px;
  display: flex;
  justify-content: center;
  //background: linear-gradient(to right, #f2f6fa, #e0ecf3);
}

.search-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.3);
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  gap: 12px;
  flex-wrap: wrap;
  max-width: 800px;
  width: 100%;
  align-items: center;
}

.search-select,
.search-input {
  flex: 1;
  min-width: 160px;
}

.search-button {
  white-space: nowrap;
  height: 40px;
}

@media (max-width: 600px) {
  .search-bar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .search-button {
    width: 100%;
  }
}
</style>
